package org.dyr.team02.recruit.dao;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.dyr.team02.recruit.bean.TestUser;
import org.dyr.team02.recruit.mapper.TestUserMapper;
import org.springframework.stereotype.Repository;

@Repository
public class TestUserDao implements TestUserMapper{
	@Resource
	private SqlSessionFactory sqlSessionFactory;
	
	@Override
	public TestUser login(TestUser testUser) {
		SqlSession sqlSession=sqlSessionFactory.openSession();
		TestUserMapper testUserMapper=sqlSession.getMapper(TestUserMapper.class);
		TestUser newUser=testUserMapper.login(testUser);
		sqlSession.close();
		return newUser;
	}

}
